﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Resources;
using System.Globalization;
using System.Threading;

namespace TVGuide.Common
{
    public class ResUtil
    {
        private string lang;
        private ResourceManager com_res_manager;
        private CultureInfo culture;
        private static Dictionary<int, string> Lang = new Dictionary<int, string>() { { 1, "hy-AM" }, { 2, "en-US" } };
        
        public ResUtil(string lang)
        {
            this.lang = lang;
            this.com_res_manager = new global::System.Resources.ResourceManager("TVGuide.Common.Main", System.Reflection.Assembly.GetExecutingAssembly());
            this.culture = Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
        }

        public static string GetLang(int lng)
        {
            return Lang[lng];
        }

        public string GetCommonResourceString(String name)
        {
            return com_res_manager.GetString(name, culture);
        }
    }
}
